﻿using System;
using System.Collections.Generic;
using System.Security;
using System.Threading.Tasks;

namespace EnglishStudy.Service
{
    /// <summary>
    /// This interface exposes RESTful functionality using HTTPClient. 
    /// </summary>
    [SecurityCritical]
    public interface IRestfulHttpClient 
    {

        void Init(Uri baseUri);

        void Init(String baseUri);

        /// <summary>
        /// Does an HTTP Post asychronously putting the given parms in the post body as application/x-www-form-urlencoded.
        /// </summary>
        /// <param name="servicePath">Service path appended to the HttpClient's base URI.  Example: <example>setup/user/key/v3</example></param>
        /// <param name="parms">key-value pairs as the parameters in the post body.  Example: <example>"Username", "greenbay@myqa.us"</example> </param>
        /// <param name="acceptMediaType">Accept Header.  Example: <example>application/json</example></param>
        /// <returns>HttpResponseMessage</returns>
      
        Task<IHttpResponseMessage> PostFormUrlEncodedAsync(string servicePath, IDictionary<string, string> parms, string acceptMediaType = "application/json");
         /// <summary>
         /// 
         /// </summary>
         /// <param name="userName"></param>
         /// <param name="etoken"></param>
         /// <param name="servicePath"></param>
         /// <param name="parms"></param>
         /// <param name="acceptMediaType"></param>
         /// <returns></returns>
        Task<IHttpResponseMessage> PostFormUrlEncodedAsyncWithUser(string userName, string etoken, string servicePath, IDictionary<string, string> parms, string acceptMediaType = "application/json");
        /// <summary>
        /// Does an HTTP Get asychronously putting the given parms as query string parameters.
        /// </summary>
        /// <param name="servicePath">Service path appended to the HttpClient's base URI.  Example: <example>setup/user/key/v3</example></param>
        /// <param name="parms">key-value pairs as the parameters to put in the query string parameters.  Example: <example>"Username", "greenbay@myqa.us"</example> </param>
        /// <param name="acceptMediaType">Accept Header.  Example: <example>application/json</example></param>
        /// <returns>HttpResponseMessage</returns>
      
        Task<IHttpResponseMessage> GetAsync(string servicePath, IDictionary<string, string> parms, string acceptMediaType = "application/json");

    }
}
